package com.jiahao.quickshot;

import android.os.FileObserver;
import android.util.Log;

/**
 * Created by hp on 2016/8/26 18:28.
 */
public class ScreenShotsLister extends FileObserver {

    private static String TAG = "FileObserver";

    public ScreenShotsLister(String path) {
        super(path);
    }

    @Override
    public void onEvent(int i, String path) {
        switch(i) {
            case FileObserver.ALL_EVENTS:
                Log.d(TAG, "path:"+ path);
                break;
            case FileObserver.ACCESS:
                Log.d(TAG, "event: 文件或目录被访问, path: " + path);
                break;

            case FileObserver.DELETE:
                Log.d(TAG, "event: 文件或目录被删除, path: " + path);
                break;

            case FileObserver.OPEN:
                Log.d(TAG, "event: 文件或目录被打开, path: " + path);
                break;

            case FileObserver.MODIFY:
                Log.d(TAG, "event: 文件或目录被修改, path: " + path);
                break;

            case FileObserver.CREATE:
                Log.d(TAG, "event: 文件或目录被创建, path: " + path);
                break;
        }
    }
}
